package org.eleorc.ioc.container.extension.beanfactorypostprocessor;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class Demo {
    public static void main(String[] args) throws SQLException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans-factorypostprocessor.xml");
        DataSource bean = context.getBean(DataSource.class);
        System.out.println(bean);
        // Exception in thread "main" java.sql.SQLException: Cannot load JDBC driver class 'org.hsqldb.jdbcDriver'
        Connection connection = bean.getConnection();
        System.out.println(connection);
        connection.close();
    }
}
